CREATE TABLE [dbo].[TCREND_ANUL]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[NU_REND_GAST] [dbo].[TD_VC_010] NOT NULL,
[FE_REND_GAST] [dbo].[TD_DT_001] NOT NULL,
[FE_ANUL] [dbo].[TD_DT_001] NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TCREND_AN__ST_CO__5006DFF2] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCREND_AN__NU_PR__51EF2864] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCREND_AN__CO_US__52E34C9D] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCREND_AN__FE_US__53D770D6] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCREND_AN__CO_US__54CB950F] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCREND_AN__FE_US__55BFB948] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCREND_ANUL] WITH NOCHECK ADD CONSTRAINT [CK__TCREND_AN__ST_CO__50FB042B] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TCREND_ANUL] ADD CONSTRAINT [PK__TCREND_A__89C688D33FE65219] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCREND_ANUL] ADD CONSTRAINT [FK__TCREND_ANUL__15A5FF8A] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST]) REFERENCES [dbo].[TCREND_GAST] ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST])
GO
